import { FishPathInfo } from "../../script/game/config/FishPathInfo";
import FishManager from "../../script/game/manager/FishManager";
import { FishInfo } from "../../script/game/config/FishInfo";


const { ccclass, property } = cc._decorator;

@ccclass
export default class FishBase extends cc.Component {

    public fishInfo:FishInfo;
    public fishType: number = 1;
    public blood:number = 1;
    public fishPathInfo: FishPathInfo;
    public isDead: boolean;

    onLoad() {
    }

    start() {

    }

    public playDeadMv() {
        this.isDead = true;
        this.scheduleOnce(()=>{
            FishManager.instance.killFish(this)
        }, 1.5)
        cc.tween(this.node)
            .repeatForever(
                cc.tween().by(0.6, { angle: -360 })
            ).start()
    }

    onDisable() {
        this.node.stopAllActions();
        this.unscheduleAllCallbacks();
    }

}
